
import * as types from '../ActionType';

const initialState = {
  loading: false,
  login: false,
};

export default function UserReducer(state = initialState, action = {}) {

  switch (action.type) {

    case types.LOGIN_ING:
      return Object.assign({}, state, {
        loading: true, login: true,
      });

    case types.LOGIN_SUCCESS:
      return Object.assign({}, state, {
        loading: false, login: true,
      });

    case types.LOGOUT_SUCESS:
      return Object.assign({}, state, {
        loading: false, login: false,
      });
    default:
      return state;
  }
}
